﻿import java.util.Scanner;

public class code042{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		double result = 0.0;
		System.out.println("请输入第一个数字)");
		double num1 = input.nextInt();
		System.out.println("请输入运算符1.+\t2.-\t3.*\t4./)");
		char fu = input.next().charAt(0);
		System.out.println("请输入第二个数字)");
		if(input.hasNextInt()){
		double num2 = input.nextInt();
			switch(fu){
			case '+':
				result = num1+num2;
				System.out.println("和是："+num1+fu+num2+"="+result);
				break;
			case '-':
				result = num1-num2;
				System.out.println("和是："+num1+fu+num2+"="+result);
				break;
			case '*':
				result = num1*num2;
				System.out.println("和是："+num1+fu+num2+"="+result);
				break;
			case '/':
				if(num2==0){
					System.out.println("除数不能为0");
				}else{
					result = num1/num2;
					System.out.println("和是："+num1+fu+num2+"="+result);
				}
				break;
				default:
					System.out.println("输入错误");
					break;
			}
			
		}else{
			System.out.println("请输入正确的数字");
		}
	}
}